﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Wintellect.LiveFx.Cloudboard
{
  /// <summary>
  /// Interaction logic for AboutBox.xaml
  /// </summary>
  public partial class AboutBox : Window
  {
    public AboutBox()
    {
      InitializeComponent();
      this.Title = "About " + Constants.AppName;
      System.Reflection.Assembly currentAssembly = System.Reflection.Assembly.GetEntryAssembly();
      this.version.Text = currentAssembly.GetName().Version.ToString();
      System.Reflection.AssemblyCopyrightAttribute[] copyrights = currentAssembly.GetCustomAttributes(typeof(System.Reflection.AssemblyCopyrightAttribute), false) as System.Reflection.AssemblyCopyrightAttribute[];
      this.copyright.Text = copyrights[0].Copyright;
    }

    private void link_Click(object sender, RoutedEventArgs e)
    {
      System.Windows.Documents.Hyperlink clickedLink = sender as System.Windows.Documents.Hyperlink;
      if (clickedLink == null) return;
      System.Diagnostics.Process.Start(clickedLink.NavigateUri.ToString());
    }

    private void cloudBoard_MouseDown(object sender, MouseButtonEventArgs e)
    {
      System.Diagnostics.Process.Start(this.cloudboardGroupLink.NavigateUri.ToString());
    }

    private void wintellectLogo_MouseDown(object sender, MouseButtonEventArgs e)
    {
      System.Diagnostics.Process.Start(this.wintellectLink.NavigateUri.ToString());
    }
  }
}
